
package net.minecraft.src;

import java.util.Random;

public class ItemAlgae extends Item
{

    public ItemAlgae(int i, int j)
    {
        super(i);
		placedMetadata = j;
    }

    public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
    {
		if(world.getBlockId(i, j + 1, k) != Block.waterStill.blockID && (world.getBlockMaterial(i, j, k) == Material.water || world.getBlockMaterial(i, j + 1, k) == Material.water ||  world.getBlockMaterial(i, j - 1, k) == Material.water))
		{
			world.setBlockAndMetadataWithNotify(i, j + 1, k, mod_pph.algae.blockID, placedMetadata);
			return true;
		} else
		if(world.getBlockId(i, j + 1, k) == Block.waterStill.blockID)
		{
			world.setBlockAndMetadataWithNotify(i, j + 2, k, mod_pph.algae.blockID, placedMetadata);
			return true;
		} else
		{
			return false;
		}
    }
	
	public int placedMetadata;
}
